<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse">
                <span class="sr-only">顶部导航</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="__ROOT__/"><?php echo tpx_config_get('home_title', 'Doc.MZ文档管理系统'); ?></a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <?php if(MEMBER_LOGINED){ ?>
                    <if condition="CONTROLLER_NAME=='Document' && ACTION_NAME=='post'">
                    <else />
                        <li <if condition="CONTROLLER_NAME=='Document' && ACTION_NAME=='post'">class="active"</if>><a href="{:U('Document/post')}">新建文档</a></li>
                    </if>
                    <li <if condition="CONTROLLER_NAME eq 'Document'">class="active"</if>><a href="{:U('Document/mylist')}">我的文档</a></li>
                    <li <if condition="CONTROLLER_NAME eq 'DocumentCat'">class="active"</if>><a href="{:U('DocumentCat/mylist')}">文档分类</a></li>
                <?php } ?>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <if condition="MEMBER_LOGINED">
                    <li class="dropdown">
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" role="button"
                           aria-expanded="false">
                            {$data_username|htmlspecialchars}
                            个人中心
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="{:U('User/profile')}">个人资料</a></li>
                            <li><a href="{:U('User/changepwd')}">修改密码</a></li>
                            <li class="divider"></li>
                            <li><a href="{:U('User/logout')}">退出</a></li>
                        </ul>
                    </li>
                    <else />
                    <li><a href="{:U('User/register')}">注册</a></li>
                    <li><a href="{:U('User/login')}">登录</a></li>
                </if>
            </ul>
        </div>
    </div>
</nav>